Skip to content

mod_cache: Parse comma separated Cache-Control directives again. - #821

Closed
arturobernalg wants to merge 1 commit into
apache:trunkfrom
arturobernalg:fix/httpd-70028-cache-control-comma-list
Closed

arturobernalg wants to merge 1 commit into
apache:trunkfrom
arturobernalg:fix/httpd-70028-cache-control-comma-list

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

cache_strqtok() did not end a token at a comma or whitespace unless an argument followed, so "private, no-store" was read as one token and the response was stored. Stop at any non-token character, after the '=' test. BZ 70028.


  • [X ] This PR does not report or address a security vulnerability
    (see SECURITY.md and
    https://www.apache.org/security/#reporting-a-vulnerability).
  • [X ] Code follows the httpd style guide.
  • [X ] New log messages (level debug or higher) use an empty APLOGNO() tag;
    numbers are assigned by a committer at merge time (see docs/log-message-tags/README).
  • [X ] If the change is user-visible, a changes-entries/*.txt file is included,
    following the template in README.CHANGES (not needed otherwise).
  • [X ] Test cases based on pyhttpd are included where appropriate, in the
    test/modules/xxx directory matching the modules/xxx module source,
    or test/modules/core for core server changes. On Unix, verify these
    pass locally with e.g. make check-pytest PYTEST_DIRS=test/modules/xxx.

@notroj notroj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a trunk-specific regression it doesn't need a changes-entry. This broke somewhere in the r1856507 / r1856500 / r1856493 sequence? It would be good to reference that in the commit message.

Otherwise LGTM

@arturobernalg
arturobernalg force-pushed the fix/httpd-70028-cache-control-comma-list branch from bd231e5 to 4a0b459 Compare October 19, 2026 09:48
cache_strqtok() did not end a token at a comma or whitespace unless an argument followed, so "private, no-store" was read as one token and the response was stored. Stop at any non-token character, after the '=' test.

This is a trunk-only regression from r1856507, which rewrote the tokenizer as a state machine and dropped the T_HTTP_TOKEN_STOP check in the token state that r1856493 and r1856500 still had.

BZ 70028.
@arturobernalg
arturobernalg force-pushed the fix/httpd-70028-cache-control-comma-list branch from 4a0b459 to f6f13ef Compare October 19, 2026 09:57
@arturobernalg

Copy link
Copy Markdown
Member Author

Thanks for the review. I removed the changes-entry, and the commit message now references r1856507 as the revision that introduced the regression: it rewrote cache_strqtok() as a state machine and dropped the T_HTTP_TOKEN_STOP check in the token state that r1856493 and r1856500 still had.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants